import javax.sound.midi.MidiChannel;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Synthesizer;


public class Clou {
	
	private float rayon = Constant.rayonClou;
	private float x;
	private float y;
	private int r;
	private int g;
	private int b;
	private int note;
	
    Synthesizer synthesizer;
    MidiChannel channel;
    
	public Clou(float x, float y){
		this.x = x;
		this.y = y;
		this.r = 255;
		this.g = 255;
		this.b = 0;
		this.note = 60;
	}
	
	public float getX() {
		return this.x;
	}
	
	public float getY() {
		return this.y;
	}
	
	public float getRayon() {
		return this.rayon;
	}
	public void drawClous(GraphicsWrapper gw){
		
		//gw.drawClous(this.x, this.y, this.rayon, this.r,this.g,this.b);
		
		gw.setColor(this.r, this.g, this.b);
		gw.drawCenteredCircle(this.x, this.y, this.rayon, true);
	}
	
	public void setNote(int note){
		this.note = note;
		//this.r = note+100;
		//this.g = note+100;
		//this.b = note;
	}
	
	public void setColor(int r, int g, int b){
		this.r = r;
		this.g = g;
		this.b = b;
	}
	
	public int getNote(){
		return this.note;
	}
	
	//http://stackoverflow.com/questions/7147294/how-to-generate-pure-tones-with-different-decibels-in-java
	
	/*public void playNote(){
		int Min = 21;
		int Max = 108;
		note = (int) (Min + (Math.random() * (Max - Min)));
		channel.noteOn(note, 50);
          try {
              Thread.sleep(200);
          } catch (InterruptedException e) {
              //break;
          } finally {
              channel.noteOff(note);
          }
	}*/
	
}
